package com.zros.modules.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author pangyinqiang
 * @since 2019-04-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_sys_data_resource")
@ApiModel(value="DataResource对象", description="")
public class DataResource extends Model<DataResource> {

    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;
    
    private Long parentId;

    private String dataResourceType;

    private String dataResourceName;

    private String dataResourceKey;

    private String dataResourceMethod;

    private String dataResourceLevel;

    private String description;

    private LocalDateTime createTime;

    private String creator;

    private LocalDateTime updateTime;

    private String operator;

    private String delFlag;

    /**
     * 是否是叶子节点
     */
    @TableField(exist = false)
    private Long isLeaf;

    /**
     * 子菜单，必须初始化否则vue新增不展示树子菜单
     */
    @TableField(exist = false)
    private List<DataResource> children = new ArrayList<>();
    
    @Override
    protected Serializable pkVal() {
        return null;
    }

}
